/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using DaveSexton.DocProject.Sandcastle.TopicManagement;

namespace DaveSexton.DocProject.Sandcastle.ContentManagement
{
	[Serializable]
	public sealed class XmlCommentSectionAttributeData : ITopicSectionAttributeData		// Attribute is a reserved suffix, so Data was appended
	{
		#region Public Properties
		public string Name
		{
			get
			{
				return name;
			}
		}

		public TopicSectionAttributeType AttributeType
		{
			get
			{
				return type;
			}
		}
		#endregion

		#region Private / Protected
		private readonly string name;
		private readonly TopicSectionAttributeType type;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="XmlCommentSectionAttributeData" /> class.
		/// </summary>
		public XmlCommentSectionAttributeData(string name, TopicSectionAttributeType type)
		{
			if (string.IsNullOrEmpty(name))
				throw new ArgumentException(Resources.Errors.NullOrEmpty, "name");

			if (!Enum.IsDefined(typeof(TopicSectionAttributeType), type))
				throw new InvalidEnumArgumentException("type", (int) type, typeof(TopicSectionAttributeType));

			this.name = name;
			this.type = type;
		}
		#endregion

		#region Methods
		public override string ToString()
		{
			return name;
		}
		#endregion
	}
}
